{extend name="base" /}
{block name="body"}
<div class="layui-body">
    <!--tab标签-->
    <div class="layui-tab layui-tab-brief">
        <ul class="layui-tab-title">
            <li class="layui-this">会员管理</li>
            <li class=""><a href="{:url('admin/member/add')}">添加会员</a></li>
            <li class=""><a href="{:url('admin/member/import')}">导入会员</a></li>
        </ul>
        <div class="layui-tab-content">
            <div class="layui-tab-item layui-show">

                <form class="layui-form layui-form-pane" action="{:url('admin/member/index')}" method="get">
                    <div class="layui-inline">
                        <label class="layui-form-label">账号 ：</label>
                        <div class="layui-input-inline">
                            <input type="text" name="account" value="{:input('param.account')}" placeholder="请输入账号" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label">证书编号 ：</label>
                        <div class="layui-input-inline">
                            <input type="text" name="certificate_code" value="{:input('param.certificate_code')}" placeholder="请输入证书编号" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label">电邮 : </label>
                        <div class="layui-input-inline">
                            <input type="text" name="email" value="{:input('param.email')}" placeholder="请输入电邮" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label">电话 :</label>
                        <div class="layui-input-inline">
                            <input type="text" name="phone" value="{:input('param.phone')}" placeholder="请输入电话" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <button class="layui-btn">搜索</button>
                    </div>
                </form>
                <hr>

                <form action="" method="post" class="ajax-form">
                <button type="button" class="layui-btn layui-btn-danger layui-btn-small ajax-action" data-action="{:url('admin/member/delete')}">删除</button>
                <table class="layui-table">
                    <thead>
                    <tr>
                        <th style="width: 15px;"><input type="checkbox" class="check-all"></th>
                        <th style="width: 30px;">编号</th>
                        <th>账号</th>
                        <th>证书编号</th>
                        <th>电话</th>
                        <th>电邮</th>
                        <th>传真</th>
                        <th>公司</th>
                        <th>职位</th>
                        <th>加入时间</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    {if condition="$data->toArray()['data']"}
                    {foreach name="data" item="vo"}
                    <tr>
                        <td><input type="checkbox" name="ids[]" value="{$vo.id}"></td>
                        <td>{$vo.id}</td>
                        <td>{$vo.account}</td>
                        <td>{$vo.certificate_code}</td>
                        <td>{$vo.phone}</td>
                        <td>{$vo.email}</td>
                        <td>{$vo.fax}</td>
                        <td>{$vo.organization}</td>
                        <td>{$vo.job_title}</td>
                        <td>{$vo.add_time|date="Y-m-d H:i:s",###}</td>
                        <td>
                            <a href="{:url('admin/member_pay/index',['member_id'=>$vo['id']])}" class="layui-btn layui-btn-mini layui-btn-primary pay">支付信息</a>
                            <a href="javascript:;" data-id='{$vo.id}' class="layui-btn layui-btn-mini after">后续课程</a>
                            <a href="{:url('admin/member_addr/index',['member_id'=>$vo['id']])}" class="layui-btn layui-btn-warm layui-btn-mini">地址</a>
                            <a href="{:url('admin/member/edit',['id'=>$vo['id']])}" class="layui-btn layui-btn-normal layui-btn-mini">编辑</a>
                            <a href="{:url('admin/member/delete',['id'=>$vo['id']])}" class="layui-btn layui-btn-danger layui-btn-mini ajax-delete">删除</a>
                        </td>
                    </tr>
                    {/foreach}
                    {else/}
                    <tr>
                        <td colspan="15" style="text-align: center;"><i class="fa fa-exclamation-circle"></i>没有数据</td>
                    </tr>
                    {/if}
                    </tbody>
                </table>
                <!--分页-->
                {$page}
                </form>
            </div>
        </div>
    </div>
</div>
{/block}
{block name="script"}
<script>
    $('.after').on('click',function(){
        var id = $(this).data('id');
        layer.open({
            type: 2,
            title: '该会员的后续课程',
            shadeClose: true,
            shade: 0.8,
            area: ['80%', '30%'],
            content: ['/admin/member/after/member_id/'+id,'no'] 
          });
    })
     
</script>    
{/block}